package com.dy.nygl.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.dy.nygl.mapper.EnergyTypeMapper;
import com.dy.nygl.pojo.EnergyType;
import com.dy.nygl.service.EnergyTypeService;

@Service("energyTypeService")
public class EnergyTypeServiceImpl implements EnergyTypeService{

	@Resource(name="energyTypeDAO")
	private EnergyTypeMapper energyTypeDAO;
	
	public List<EnergyType> getEnergyType() {
		List<EnergyType> list = energyTypeDAO.getEnergyType();
		if(list.size()>0) {
			return list;
		}
		return null;
	}
	
	public EnergyType getEnergyTypeById(int id) {
		EnergyType devicetype = energyTypeDAO.getEnergyTypeById(id);
		if(devicetype != null) {
			return devicetype;
		}
		return null;
	}

}
